package com.share.bean.sysmgr.privilege;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.share.bean.oa.org.Employee;

/**
 * <p>Title：权限资源保护</p>
 * <p>Description：</p>
 * @Author 杨浩泉
 * @Date 2010-2-28
 */
@Entity
@Table(name="share_privilegeResource")
public class PrivilegeResource implements Serializable {
	
	private static final long serialVersionUID = 1L;

	private int resId ;
	
	private String resName ;
	
	private String resType ;
	
	private String resUrl ;
	
	private int resPriorty ;
	
	private String resDesc ;
	
	private Set<PrivilegeRole> role ;
	
	private Set<Employee> employee ;
	
	private PrivilegeResourceItem resItem ;

	@ManyToMany(mappedBy="resource")
	public Set<Employee> getEmployee() {
		return employee;
	}

	public String getResDesc() {
		return resDesc;
	}

	@Id
	@GeneratedValue
	public int getResId() {
		return resId;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="resItem_id")
	public PrivilegeResourceItem getResItem() {
		return resItem;
	}

	public String getResName() {
		return resName;
	}

	public int getResPriorty() {
		return resPriorty;
	}

	public String getResType() {
		return resType;
	}

	public String getResUrl() {
		return resUrl;
	}

	@ManyToMany(mappedBy="resource")
	public Set<PrivilegeRole> getRole() {
		return role;
	}

	public void setEmployee(Set<Employee> employee) {
		this.employee = employee;
	}

	public void setResDesc(String resDesc) {
		this.resDesc = resDesc;
	}

	public void setResId(int resId) {
		this.resId = resId;
	}

	public void setResItem(PrivilegeResourceItem resItem) {
		this.resItem = resItem;
	}

	public void setResName(String resName) {
		this.resName = resName;
	}

	public void setResPriorty(int resPriorty) {
		this.resPriorty = resPriorty;
	}

	public void setResType(String resType) {
		this.resType = resType;
	}

	public void setResUrl(String resUrl) {
		this.resUrl = resUrl;
	}

	public void setRole(Set<PrivilegeRole> role) {
		this.role = role;
	}

}
